package com.cly.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cly.domain.ProdPropValue;
import com.cly.mapper.ProdPropValueMapper;
import com.cly.service.ProdPropValueService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ProdPropValueServiceImpl extends ServiceImpl<ProdPropValueMapper, ProdPropValue> implements ProdPropValueService{

    @Autowired
    private ProdPropValueMapper prodPropValueMapper;

    /**
     * 根据属性id查询属性值集合
     *
     * @param propId
     * @return
     */
    @Override
    public List<ProdPropValue> findPropValueByPropId(Long propId) {
        List<ProdPropValue> prodPropValues = prodPropValueMapper.selectList(new LambdaQueryWrapper<ProdPropValue>()
                .eq(ProdPropValue::getPropId, propId)
        );
        return prodPropValues;
    }
}
